package com.shiguiwu.springmybatis.spring.cycle;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.ComponentScan;

/**
 * @description: 多例和单例测试 全报错
 * @author: stone
 * @date: Created by 2021/11/17 23:35
 * @version: 1.0.0
 * @pakeage: com.shiguiwu.springmybatis.spring.cycle
 */
@ComponentScan
public class PrototypeAndSingletonTests {

    public static void main(String[] args) {
        AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(PrototypeAndSingletonTests.class);


        //PrototypeBean prototypebean = context.getBean(PrototypeBean.class);

        //SingletonBean singletonbean = context.getBean(SingletonBean.class);
        SingletonBean singletonbean = (SingletonBean) context.getBean("singletonBean");

        //Object bean = context.getBean("prototypebean");


        System.out.println(singletonbean);
        //System.out.println(singletonbean == prototypebean.getSingletonBean());


    }


}
